package A1_4_Shopsystem;

// 支付方式抽象类
public abstract class Payment {
    protected double amount;
    protected Order order; // 关联关系：支付对应一个订单

    public Payment(double amount, Order order) {
        this.amount = amount;
        this.order = order;
        order.setPayment(this); // 建立双向关联
    }

    // 抽象方法，具体支付方式实现
    public abstract boolean processPayment();

    // Getter 和 Setter 方法
    public double getAmount() { return amount; }
    public Order getOrder() { return order; }
}

